﻿#include <iostream>
#include <vector>
#include <string> 
#include "Game.h"

using namespace std;

int main(){
	cout << "Welcome to Blackjack" << endl;
	int numPlayers = NULL;
	vector<string> names;
	string name;
	char again = 'y';

	while(again== 'y' || again== 'Y')
	{
		// Number of players
		numPlayers = 0;
		cout << "How many players? (1 − 7): ";
		cin >> numPlayers;
		while (numPlayers < 1 || numPlayers > 7) {
			cout << "How many players? (1 − 7): ";
			cin >> numPlayers;
		}
		// Player names
		names.clear();		
		for (int i=0; i<numPlayers; i++) {
			cout << "Enter player name: ";
			cin >> name;
			names.push_back(name);
		}
		cout << endl;
		// Play the game
		Game game(names);
		game.play();
		cout << endl << "Do you want to play again? (y/n): ";
		cin >> again;
	}
	cout<<"Thank you for playing. Bye Bye" << endl;
	system("pause");
	return 0;
}